﻿_obj = _this select 0;
_appel = _this select 1;

_fob = "Fort_Barracks_USMC" createvehicle (getpos _obj);
_fob setdir ((getdir _obj)+180);
_obj removeaction (_this select 2);
_fob setvectorup [(sin(180+getdir _obj))*((_obj weaponDirection (primaryWeapon _obj)) select 2),(cos(180+getdir _obj))*((_obj weaponDirection (primaryWeapon _obj)) select 2),1];
_Actvali = _obj addAction [("<t color=""#00FF00"">" + ("Valider") +"</t>"),"valider.sqf", "", 1, false, true, "","_this==_target"];
_ActAnnu = _obj addAction [("<t color=""#FF0000"">" + ("Annuler") +"</t>"),"annuler.sqf", "", 1, false, true, "","_this==_target"];

while {(valider == 0) AND (Annuler == 0)} do {
	_fob setpos [(getpos _obj select 0)+(3*sin(getdir _obj)),(getpos _obj select 1)+(3*cos(getdir _obj)),getpos _obj select 2];
	_fob setdir ((getdir _obj)+180);
	_fob setvectorup [(sin(180+getdir _obj))*((_obj weaponDirection (primaryWeapon _obj)) select 2),(cos(180+getdir _obj))*((_obj weaponDirection (primaryWeapon _obj)) select 2),1];
	sleep 0.3;
};

_obj removeaction _actvali;
_obj removeaction _actannu;

if (Annuler == 1) then {
	deletevehicle _fob;
	waitUntil {Annuler == 0};
	_obj addAction [("<t color=""#FFA500"">" + ("Placer une FOB") +"</t>"),"placer_fob.sqf", "", 1, false, true, "","_this==_target"];
} else {};
